package com.model;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table (name="pedido")
public class Pedido {

	@Id
	@GeneratedValue
	private int code;
	@Column
	private double valor;
	@Temporal (TemporalType.DATE)
	private  Calendar d_aluguel;
	@Temporal (TemporalType.DATE)
	private Calendar d_devolucao;
	@OneToMany(mappedBy="codigo")
	private Collection<Filmes> filme = new ArrayList<Filmes>();
	@ManyToOne
	@JoinColumn(name="id_Cliente", insertable=false, updatable=false)
	private Cliente  cliente;
	
	public double getValor() {
		return valor;
	}
	public void setValor(double valor) {
		this.valor = valor;
	}
	public Calendar getD_aluguel() {
		return d_aluguel;
	}
	public void setD_aluguel(Calendar d_aluguel) {
		this.d_aluguel = d_aluguel;
	}
	public Calendar getD_devolucao() {
		return d_devolucao;
	}
	public void setD_devolucao(Calendar d_devolucao) {
		this.d_devolucao = d_devolucao;
	}
	public Collection<Filmes> getFilme() {
		return filme;
	}
	public void setFilme(Collection<Filmes> filme) {
		this.filme = filme;
	}
	public Cliente getCliente() {
		return cliente;
	}
	public void setCliente(Cliente cliente) {
		this.cliente = cliente;
	}
	public int getCode() {
		return code;
	}
	
	
}
